def encrypt(key,message):        
    translated=""
    message=message.upper()
    for ch in message:
        if key>25 or key<1:
            print("请输入1-25内的密钥")
            break
        if ord(ch)<ord("A") or ord(ch)>ord("Z"):
            continue
        if ord(ch)+key >=91:
            translated = translated + chr(ord(ch)+key-26)
        else:
            translated = translated + chr(ord(ch)+key)
        
    return translated
        
        
print(encrypt(3,"i love CHINA"))